﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Frogism.Core {
  public class TransactionType {
      internal TransactionType()
      {
      }
    public static TransactionType Create(int value) {
      switch (value) {
        case DBConst.TransactionTypeExpense:
          return Expense;
        case DBConst.TransactionTypeDeposit:
          return Deposit;
        case DBConst.TransactionTypeBill:
          return Bill;
        case DBConst.TransactionTypeTransfer:
          return Transfer;
        case DBConst.TransactionTypeMarketAdjustment:
          return MarketAdjustment;
        case DBConst.TransactionTypePayment:
          return Payment;
        case DBConst.TransactionTypeInterest:
          return Interest;
        default:
          throw new NotImplementedException();
      }
    }
    
    public static TransactionType Expense = new TransactionType(1,"exp") ;
    public static TransactionType Deposit = new TransactionType(2, "dep");
    public static TransactionType Bill = new TransactionType(3, "bill");
    public static TransactionType Transfer = new TransactionType(4, "trans");
    public static TransactionType Payment = new TransactionType(5, "pay");
    public static TransactionType MarketAdjustment = new TransactionType(6, "ma");
    public static TransactionType Interest = new TransactionType(7, "int");




    private TransactionType(int value,string shortName) {
      this._id = value;
      this._shortName = shortName;
    }
    private int _id;
    public virtual int Value { get { return _id; } }
    private string _shortName;
    public virtual string ToShortString()
    {
        return _shortName;
     

    }
    public override string ToString() {
      return this.ToShortString();     
    }
  }
}
